<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<div id='divflash'>
    <%
        if (TempData.ContainsKey("flash") || TempData.ContainsKey("flasherror"))
        {
        
    %>

    <script type="text/javascript">
        $(document).ready(function() {

    <%
        var _flashmsg = "";
        if (TempData.ContainsKey("flash"))
            _flashmsg = (TempData["flash"] as string);
        if (TempData.ContainsKey("flasherror"))
            _flashmsg = (TempData["flasherror"] as string); 
    %>
    <% if (!string.IsNullOrEmpty(_flashmsg))
       {%>
    showflash("<%= Html.AttributeEncode(_flashmsg) %>");
    <%}%>
        });
    </script>

    <%
        }
    %>
</div>
